package com.wxj.book.service.impl;

import com.wxj.book.dao.CategoryMapper;
import com.wxj.book.pojo.Category;
import com.wxj.book.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    /**
     * 查询所有分类
     */
    @Override
    public List<Category> getAll() {
        return categoryMapper.getAll();
    }

    /**
     * 查询分类名称
     * @param categoryId
     * @return
     */
    @Override
    public Category getCategoryName(Integer categoryId) {
        return categoryMapper.selectById(categoryId);
    }

}
